Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

154
Views
Prueba de Node.js/Jest: expect(jest.fn()).toBeCalledWith()) arroja un error sobre "Número de llamadas: 0"

Tengo un problema con una prueba que se crea a partir de otras pruebas similares, el problema es que esta prueba en particular no pasa y no puedo entender qué está causando esto.

Código:

 it('should call notify on the channel', done => { httpServicePostMock.mockReturnValue({ subscribe: fn => { fn({ data: { data: { flightPlans: flightplanss } } }); done(); }, }); const channelNotifyMock = jest.fn(); jest.spyOn(channelGateway, 'notify').mockImplementation(channelNotifyMock); controller.addSubscriptionByDgsId('clientId', 'stand2'); expect(channelNotifyMock).toBeCalledWith(['clientId'], 'flight_plans/stand2', JSON.stringify(flightplanss)); }); });

Y el error dice que el número de llamadas es igual a 0.

ingrese la descripción de la imagen aquí

Tal vez alguien me puede dar una pista de cómo solucionarlo?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!